<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Income extends BaseModel
{
    public $table = 'income';
    public $timestamps = true;
    static $unguarded = true;


    public static function sendMessage($openid, $data){
        if(empty($openid) || empty($data))
            return false;
        if($data['price'] < 1)
            return false;

        sendTemplateMsg($openid, 22, [
            'price' => doubleval($data['price']),
            'content' => $data['content'],
            'page' => $data['page'] ?? "share/content"
        ], 28);
    }
}
